package com.mibao.activity;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

import com.mibao.adapter.AppStartViewPager;
import com.mipai.R;
/**
 * @author xieyinchao
 * 判断首次安装或者打开app的逻辑，几乎不需要修改。
 */
public class WizardActivity extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_layout);
		SharedPreferences preferences = getSharedPreferences("first_pref", MODE_PRIVATE);
		boolean isFirstIn = preferences.getBoolean("isFirstIn", true);

		if (isFirstIn) {
			Intent intent = new Intent(this, AppStartViewPager.class);
			startActivity(intent);
		} else {
			Intent intent = new Intent(this, MainActivity.class);
			startActivity(intent);
		}
		finish();
	}
}
